perm filename MANUAL.TEX[1,ALS] blob
sn#534325 filedate 1980-09-10 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00007 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00004 00002 \input manhdr.tex[mf,dek] % This is the TEX user manual source text
C00008 00003 \titlepage
C00015 00004 \manmark{Table of Contents}{\chead}\vfill\eject
C00018 00005 \chapterbegin 1. {The name of the game}
C00021 00006 \chapterbegin 2. {Book printing versus ordinary typing}
C00031 00007 \end
C00032 ENDMK
C⊗;
\input manhdr.tex[mf,dek] % This is the TEX user manual source text
\titlepage
\tenpoint
\null\vskip-46pt
\hbox to size{\:<Stanford Artificial Intelligence Laboratory\hfill September
1979}
\hbox to size{\:<Memo AIM-317.3\hfill(fourth printing)}
\vskip .25in
\hbox{\:<Computer Science Department}
\hbox{\:<Report No. STAN-CS-78-675}
\vfill
\ctrline{\:<TAU EPSILON CHI, a system for technical text}
\vskip .25in
\ctrline{$\copyright$ 1979 by the American Mathematical Society}
\vfill
{\baselineskip 7pt
\:f The author wishes to thank the many individuals who made
helpful comments on the first drafts of this manual, and especially Leo
Guibas for his help in producing copies on experimental graphics printing
equipment. Thanks are also due to
the National Science Foundation and to the Office of Naval Research,
for helping to support the author's research
under grants \hbox{MCS 72-03752 A03} and
\hbox{N00014-76-C-0330}. Since the METAFONT
system for typeface design is still under development, the type fonts used
herein are only initial approximations to the eventual ones.\par}
\eject\titlepage
\vbox to 3in{\leaders
\hbox to 3in{\lower 5.5556pt\vbox to 11.1111pt{}\leaders
\hbox{\smallTEX\hskip-6.1389pt\lower 5.5556pt\hbox{\chop to 0pt{\smallTEX}}\hskip
-6.1389pt}\hfill}\vfill}
\eject\titlepage
\vbox to 3in{\leaders
\hbox to 3in{\lower 5.5556pt\vbox to 11.1111pt{}\leaders
\hbox{\smallTEX\hskip-6.1389pt\lower 5.5556pt\hbox{\chop to 0pt{\smallTEX}}\hskip
-6.1389pt}\hfill}\vfill}
\eject\titlepage
\vbox to 3in{\leaders
\hbox to 3in{\lower 5.5556pt\vbox to 11.1111pt{}\leaders
\hbox{\smallTEX\hskip-6.1389pt\lower 5.5556pt\hbox{\chop to 0pt{\smallTEX}}\hskip
-6.1389pt}\hfill}\vfill}
\eject\titlepage
\vbox to 3in{\leaders
\hbox to 3in{\lower 5.5556pt\vbox to 11.1111pt{}\leaders
\hbox{\smallTEX\hskip-6.1389pt\lower 5.5556pt\hbox{\chop to 0pt{\smallTEX}}\hskip
-6.1389pt}\hfill}\vfill}
\gdef\chead{Preface}
\manmark{\chead}{\chead}
\setcount0 0
\eject
\titlepage
\null\vskip-10pt
\vskip 1.5in plus 1in
\ctrline{\:;TAU EPSILON CHI}
\vskip 13pt
\ctrline{\:q A SYSTEM FOR TECHNICAL TEXT}
\vskip .5in plus .5in
\tenpoint
\noindent\hangindent 25pt for 2
\hbox to 0pt{\hskip-25pt\:@\char'176\hfill}\hskip-6pt
{\:c ENTLE} R{\:c EADER}: This is a handbook about
\TEX, a new typesetting system intended for the creation
of beautiful books---and especially for books that contain a lot of
mathematics. By preparing a manuscript in \TEX\ format, you will be
telling a computer exactly how the manuscript is to be transformed into
pages whose typographic quality is comparable to that of the world's
finest printers; yet you won't need to do much more work than would be
involved if you were simply typing the manuscript on an ordinary
typewriter. In fact, your total work will probably be significantly less,
if you consider the time it ordinarily takes to revise a typewritten manuscript,
since computer text files are so easy to change and to reprocess.\xskip
(If such claims sound too good to be true, keep in mind that they were made
by \TEX's designer, on a day when \TEX\ happened to
be working, so the statements may be biased; but read on anyway.)
This manual is intended for people who have never used \TEX\ before, as
well as for experienced \TEX\ hackers. In other words, it's the only
manual there is. Everything you need to know about \TEX\ is explained
here somewhere, and so are a lot of things that most users don't need to
know. If you are preparing a simple manuscript, you won't need to
know much about \TEX\ at all; on the other hand, some
things that go into the printing of technical books are inherently
difficult, and if you wish to achieve more complex effects you
will want to penetrate into some of \TEX's darker corners. In order
to make it possible for many types of users to read this manual
effectively, a special symbol is used to designate material that is
for wizards only: When the symbol
$$\vbox{\hbox{\:@\char'177}\vskip 11pt}$$
appears at the beginning of a paragraph, it warns of a ``dangerous bend''
in the train of thought; don't read the paragraph unless you need to.
Brave and experienced drivers at the controls of \TEX\ will gradually enter
more and more of these hazardous areas, but for most applications the
details won't matter.
All that you really need to know before reading on is how to get a
file of text into your computer using a standard editing program; this
manual explains what that file ought to look like so that \TEX\ will
understand it, but basic computer usage is not explained here.
Some previous experience with technical typing will be quite helpful
if you plan to do heavily mathematical work with \TEX, although it
is not absolutely necessary. \TEX\ will do most of the necessary
formatting of equations automatically; but users with more experience
will be able to obtain better results, since there are so many ways
to deal with formulas.
Computer system manuals usually make dull reading, but take heart:
This one contains {\:m JOKES} every once in a while, so you might actually
enjoy reading it.\xskip (However, most of the jokes can only be appreciated
properly if you understand a technical point that is being made---so
read {\sl carefully}.)
Another somewhat unique characteristic of this manual is that it doesn't
always tell the truth. When informally introducing certain \TEX\
concepts, general rules will be stated, but later you will find that they
aren't strictly true. The author feels that this technique of deliberate
lying will actually make it easier for you to learn the concepts; once
you learn a simple but false rule, it will not be hard to supplement that
rule with its exceptions.
In order to help you internalize what you're reading, occasional
{\:m EXERCISES} are sprinkled through this manual. It is generally intended
that every reader should try every exercise, except for exercises that appear
in the ``dangerous bend'' areas. If you can't solve a problem, you
can always look at the answers at the end of the manual.
But please, try first to solve it by yourself; then you'll learn more
and you'll learn faster. Furthermore, if you think you do know the answer to
an exercise, you should turn to Appendix A
and check it out just to make sure.
\manmark{Table of Contents}{\chead}\vfill\eject
\vskip-12pt\vfill \ctrline{\:;CONTENTS}\vfill
\manmark{Table of Contents}{Table of Contents}\gdef\chead{Table of Contents}
\tenpoint
{\def\\#1. #2. #3.{\hbox to size{\hbox to 20pt{\hfill\bf#1. }#2
\leaders\hrule\hfill\hbox to 20pt{\hfill#3}}}
\\1. The name of the game. 4.
\\2. Book printing versus ordinary typing. 4.
\\3. Controlling \TEX. 7.
\\4. Fonts of type. 12.
\\5. Grouping. 15.
\\6. Running \TEX. 18.
\\7. How \TEX\ reads what you type. 28.
\\8. The characters you type. 33.
\\9. \TEX's standard roman fonts. 36.
\\10. Dimensions. 40.
\\11. Boxes. 41.
\\12. Glue. 45.
\\13. Modes. 50.
\\14. How \TEX\ breaks paragraphs into lines. 52.
\\15. How \TEX\ makes lists of lines into pages. 57.
\\16. Typing math formulas. 60.
\\17. More about math. 64.
\\18. Fine points of mathematics typing. 71.
\\19. Displayed equations. 91.
\\20. Definitions (also called macros). 96.
\\21. Making boxes. 99.
\\22. Alignment. 104.
\\23. Output routines. 109.
\\24. Summary of vertical mode. 114.
\\25. Summary of horizontal mode. 121.
\\26. Summary of math mode. 130.
\\27. Recovery from errors. 138.
\\A. Answers to all the exercises. 148.
\\B. Basic \TEX\ format. 151.
\\E. Example of a book format. 154.
\\F. Font tables. 168.
\\H. Hyphenation. 180.
\\I\hskip 1pt. Index. 187.
\\S. Special notes about using \TEX\ at Stanford. 198.
\\X. Recent extensions to \TEX. 199.
} % end table of contents
\chapterbegin 1. {The name of the game}
English words like ``technology'' stem from a Greek root beginning with
the letters $\tau\epsilon\chi\ldotsm$; and this same Greek word means {\sl art}
as well as technology. Hence the name \TEX, which is an upper-case form of
$\tau\epsilon\chi$.
Insiders pronounce the $\chi$ of \TEX\ as a Greek chi, not as an ``x'', so that
\TEX\ rhymes with the word blecchhh. It's the ``ch'' sound in Scottish words
like {\sl loch} or German words like {\sl ach}; it's a Spanish ``j'' and a
Russian ``kh''. When you say it properly to your computer, the terminal
may become slightly moist.
The purpose of this pronunciation exercise is to remind you that \TEX\ is
primarily concerned with high-quality technical manuscripts: its emphasis is
on art and technology, as in the underlying Greek word. If you merely want
to produce passably good quality---something acceptable and basically
readable but not really beautiful---a simpler system will usually suffice.
With \TEX\
the goal is to produce the {\sl finest} quality; this requires more attention
to detail, but fortunately it is not that much harder to go this extra
distance, and you can take special pride in the finished product.
On the other hand you might find it more comfortable to pronounce \TEX\ as
a Texan would and to shrug off all this high-falutin' nonsense about beauty
and quality. Go ahead and do what you want, the computer won't mind.
\chapterbegin 2. {Book printing versus ordinary typing}
When you first started using a computer terminal, you probably had to adjust
to the difference between the digit ``1'' and the lower case letter ``l''.
When you take the next step to the level of typography that is common in
book publishing, a few more adjustments of the same kind need to be made.
In the first place, there are two kinds of quotation marks in books, but only
one kind on the typewriter. Even on your computer terminal,
which has more characters
than an ordinary typewriter, you probably have only a non-oriented double-quote
mark ({\tt "}),
because the standard ``ascii'' code for computers was not
invented with book publishing in mind. However, your terminal probably does have
two flavors of single-quote marks, namely ` and ', which you can get by typing
{\≡≡`≡\} and {\≡≡'≡\}. The second of
these is useful also as an apostrophe.
To produce double-quote marks with \TEX, you simply type two single-quote marks
of the appropriate kind. For example, to produce an output like
$$\hbox{``I understand.''}$$
(including the quotation marks) you would type
$$\hbox{\≡≡`≡`I understand.≡'≡'≡\}$$
on your terminal.
A typewriter-like style of type will be used throughout this manual to indicate
\TEX\ constructions you might type on your terminal, so that the
symbols actually typed are readily distinguishable from the output \TEX\ would
produce and from the comments in the manual itself. Here are the symbols to be
used in the examples:
$$\save1\hbox{\≡0123456789"#$%&@*+-=,.:;?!≡\}
\save2\hbox{\≡()<>≡≤≡≥[]{}≡`≡'→↑≡↓←\|/⊗≡spose/=≡∞≡\}
\eqalign{⊗\hbox{\tt ABCDEFGHIJKLMNOPQRSTUVWXYZ}\cr
⊗\hbox{\tt abcdefghijklmnopqrstuvwxyz}\cr
⊗\box1\cr
⊗\box2\cr}$$
If these are not all on your computer terminal, do not despair; \TEX\ can make
do with the ones you have. One additional symbol
$$\hbox{\tt\char'40}$$
is also used to stand for a {\sl blank space}, in case it is important to
emphasize that a blank space is typed; without such a symbol you would have
difficulty seeing the invisible parts of certain examples.
Another important distinction between book printing and ordinary typing is
the use of dashes, hyphens, and minus signs. In good math books, these
symbols are all different; in fact there are usually at least four different
symbols in use:
$$\vbox{\halign{#\hfill\cr
a hyphen (-);\cr
an en-dash (--);\cr
an em-dash (---);\cr
a minus sign ($-$).\cr}}$$
Hyphens are used for compound words like ``daughter-in-law'' and ``X-rated''.
En-dashes are used for number ranges like ``pages 13--34'' and also in
contexts like ``exercise 1.2.6--52''. Em-dashes are used for punctuation in
sentences---they are what we often call simply dashes. And minus signs are
used in formulas. A conscientious user of \TEX\ will be careful to distinguish
these four usages, and here is how to do it:
$$\vbox{\halign{#\hfill\cr
for a hyphen, type a hyphen ({\tt -});\cr
for an en-dash, type two hyphens ({\tt --});\cr
for an em-dash, type three hyphens ({\tt ---});\cr
for a minus sign, type a hyphen in mathematics mode ({\≡$-$≡\}).\cr}}$$
(Mathematics mode occurs between dollar signs; it is discussed later, so you
needn't worry about it now.)
\yskip
If you look closely at most well-printed books, you will find that certain
combinations of letters are treated as a unit. For example, this is true of the
``f'' and the ``i'' of ``find''. Such combinations are called {\sl ligatures},
and professional typesetters have traditionally been trained to watch for letter
pairs such as {\tt ff}, {\tt fi}, {\tt fl}, {\tt ffi}, and {\tt ffl}.\xskip (It's
somewhat surprising how often these combinations appear.) Fortunately you do
{\sl not} have to concern yourself with ligatures, since \TEX\ is perfectly
capable of handling such things by itself. In fact, \TEX\ will also look
for combinations of adjacent letters (like ``{\tt A}'' next to ``{\tt V}'')
that ought to be moved closer together for better appearance; this is
called {\sl kerning}.
\yyskip
To summarize this chapter: When using \TEX\ for straight copy, you type the copy as
on an ordinary typewriter, except that you need to be careful about quotation
marks, the number 1, and various kinds of hyphens/dashes. \TEX\ will take
care of other niceties like ligatures and kerning.
\danger In case you need to type quotes within quotes, for example a single quote
followed by a double quote, you can't simply type {\≡≡'≡'≡'≡\} because \TEX\
will interpret this as ''' (namely, double-quote followed by single-quote).
If you have already read Chapter 5, you might expect that the solution will be to
use grouping---namely, to type something like
{\≡{≡'}≡'≡'≡\}. But it turns out that this doesn't produce the
desired result, because there is usually more space following a double quote
than there is following a single quote: What you get is '{}'', which is indeed
a single quote followed by a double quote (if you look at it closely enough),
but it looks almost like three equally-spaced single quotes.
On the other hand, you certainly won't want to type {\≡≡'≡char'40≡'≡'≡\}, because
this space is much too large---just as large as the space between words---and
\TEX\ might even start a new line at such a space when making up a
paragraph! There are at
least two ways to solve the problem, both of which involve more complicated
features of \TEX\ that we shall study later. First, if you
have a definition such as
$$\hbox{\≡\def\2{\hbox to 2pt{}}≡\}$$
in the format of your manuscript, you can type {\≡≡'\2≡'≡'≡\}.
This definition puts 2 points of blank space
between the quotes, so the result is '\hbox to 2pt{}''; you could, of
course, vary the amount of space, or define another control sequence besides
{\≡\2≡\} for this purpose. Second, you could use the idea of ``thin space'' in
math formulas: namely, if you type {\≡≡'$\,$≡'≡'≡\} the result will be '$\,$''.
\danger\exno 2.1: OK, now you know how to produce ''' and '$\,$''; how do you
get ``$\,$` and `{}``$\,$?\enddanger
\end